function efficiency_load_exp()
close all;
clc;

%% Soft-charging 2 Efficiency

figure;
cc=hsv(5);
marker={'x-'; 'o-';'^-';'*-';'s-'};

M1 = csvread('./data/soft_charging_2/250k_90V_4A_short.dat',1,0);
efficiency1=M1(:,7)*100;
load1=M1(:,4);
Pout1=load1.*M1(:,3);
plot(load1,efficiency1,marker{1},'color',cc(1,:),'LineWidth',1.2);
hold on;

% M2 = csvread('./data/soft_charging_2/250k_100V_2A_short.dat',1,0);
% efficiency=M2(2:end,7);
% load=M2(2:end,4);
% plot(load,efficiency,marker{2},'color',cc(2,:),'LineWidth',0.75);

% M3 = csvread('./data/soft_charging_2/250k_120V_3A_short.dat',1,0);
% efficiency=M3(2:end,7);
% load=M3(2:end,4);
% plot(load,efficiency,marker{3},'color',cc(3,:),'LineWidth',1.2);

M4 = csvread('./data/soft_charging_2/250k_150V_3A_short.dat',1,0);
efficiency4=M4(:,7)*100;
load4=M4(:,4);
Pout4=load4.*M4(:,3);
plot(load4,efficiency4,marker{4},'color',cc(4,:),'LineWidth',1.2);

M5 = csvread('./data/soft_charging_2/250k_180V_2A_short.dat',1,0);
efficiency5=M5(:,7)*100;
load5=M5(:,4);
Pout5=load5.*M5(:,3);
plot(load5,efficiency5,marker{5},'color',cc(5,:),'LineWidth',1.2);

legendInfo = {'Vin= 90V','Vin= 150V','Vin= 180V'};

xlabel('Load current (A)');
ylabel('Efficiency [%]');
legend(legendInfo,'Location','SouthEast');
grid on;
ylim([80 95]);
xlim([0 4.1]);

set(gcf, 'Position', [200 200 450 300])
set(gcf,'PaperPositionMode','auto')
print('-depsc2', './images/efficiency_unregulated_exp');
% matlab2tikz( '../Paper/images/efficiency_unregulated_exp.tikz',  'height', '\figureheight', 'width', '\figurewidth','showInfo', false);

figure;
plot(Pout1,efficiency1,marker{1},'color',cc(1,:),'LineWidth',1.2);
hold on;
plot(Pout4,efficiency4,marker{4},'color',cc(4,:),'LineWidth',1.2);
plot(Pout5,efficiency5,marker{5},'color',cc(5,:),'LineWidth',1.2);

legendInfo = {'Vin= 90V','Vin= 150V','Vin= 180V'};
xlabel('Output power (W)');
ylabel('Efficiency [%]');
legend(legendInfo,'Location','SouthEast');
grid on;
ylim([80 95]);
% xlim([0 4.1]);

set(gcf, 'Position', [200 200 450 300])
set(gcf,'PaperPositionMode','auto')
print('-depsc2', './images/efficiency_pout_unregulated_exp');
%% Soft-charging 2 Power loss

figure;
cc=hsv(5);
marker={'x-'; 'o-';'^-';'*-';'s-'};

M1 = csvread('./data/soft_charging_2/250k_90V_4A_short.dat',1,0);
Ploss=M1(2:end,5)-M1(2:end,6);
load=M1(2:end,4);
plot(load,Ploss,marker{1},'color',cc(1,:),'LineWidth',1.2);
hold on;

% M2 = csvread('./data/soft_charging_2/250k_100V_2A_short.dat',1,0);
% Ploss=M2(2:end,7);
% load=M2(2:end,4);
% plot(load,Ploss,marker{2},'color',cc(2,:),'LineWidth',0.75);

% M3 = csvread('./data/soft_charging_2/250k_120V_3A_short.dat',1,0);
% Ploss=M3(2:end,5)-M3(2:end,6);
% load=M3(2:end,4);
% plot(load,Ploss,marker{3},'color',cc(3,:),'LineWidth',1.2);

M4 = csvread('./data/soft_charging_2/250k_150V_3A_short.dat',1,0);
Ploss=M4(2:end,5)-M4(2:end,6);
load=M4(2:end,4);
plot(load,Ploss,marker{4},'color',cc(4,:),'LineWidth',1.2);

M5 = csvread('./data/soft_charging_2/250k_180V_2A_short.dat',1,0);
Ploss=M5(2:end,5)-M5(2:end,6);
load=M5(2:end,4);
plot(load,Ploss,marker{5},'color',cc(5,:),'LineWidth',1.2);

legendInfo = {'Vin= 90V','Vin= 150V','Vin= 180V'};

xlabel('Load current (A)');
ylabel('Power Loss (W)');
legend(legendInfo,'Location','SouthEast');
grid on;
% ylim([0.85 0.95]);
xlim([0 4.1]);

set(gcf, 'Position', [200 200 450 300])
set(gcf,'PaperPositionMode','auto')
print('-depsc2', './images/Ploss_unregulated_exp');
